﻿using LiteBlog.Common.Entities;
using LiteBlog.Components.Contracts;
using LiteBlog.Components.Enums;
using LiteBlog.Controllers.Contracts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiteBlog.Controllers.Tests
{
    [TestClass]
    public class CommentControllerTests : CompControllerTests<Comment, string, ICommentComp, ICommentController>
    {
        public override void DeleteGetsItem()
        {
            // Not a Test Method
        }

        [TestMethod]
        public override void DeleteWorks()
        {
            var mock = Mock.Get<ICommentComp>(_compController.GetComponent<ICommentComp>());
            mock.Setup(c => c.Delete(It.IsAny<string>())).Returns(MethodResult.DeleteSuccess);
            var id = "test";
            _compController.Delete(id);
            mock.Verify(c => c.Delete(id));
        }
    }
}
